package com.devin.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.devin.service.EchoService;

import java.util.Random;
import java.util.concurrent.TimeUnit;

@Service
public class EchoServiceImpl implements EchoService {
    @Override
    public String sayHello1(String name) {
        int time = new Random().nextInt(100);
        try {
            TimeUnit.MILLISECONDS.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return name + ",hello!";
    }

    @Override
    public String sayHello2(String name) {
        int time = new Random().nextInt(100);
        try {
            TimeUnit.MILLISECONDS.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "sayHello2: " + name;
    }

    @Override
    public String sayHello3(String name) {
        int time = new Random().nextInt(100);
        try {
            TimeUnit.MILLISECONDS.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "sayHello3: " + name;
    }
}
